public class t509 {//斐波那契数

    public static void main(String[] args) {
        int n =25;
        /*if(n == 1|| n==2 ){
            return 1;
        }
        if(n==0){
            return 0;
        }*/

        int dp [] = new int [4];
        dp[0] = 0;
        dp[1] = 1;
        dp[2] = 1;
        for(int i = 3;i<=n;i++){
            dp[i%4] = dp[(i-1)%4]+dp[(i-2)%4]+dp[(i-3)%4];
        }
        //return dp[n%4];
        System.out.println(dp[n%4]);

    }
}
